//
//  UIColor+HMColorClass.m
//  lifeCircle01
//
//  Created by mac on 16/7/12.
//  Copyright © 2016年 itheima. All rights reserved.
//

#import "UIColor+HMColorClass.h"

@implementation UIColor (HMColorClass)
+(UIColor *)hm_colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha
{
    return [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:alpha];
}
+(UIColor *)hm_colorWithHex:(int32_t)hex alpha:(CGFloat)alpha
{
    NSUInteger red = (hex >> 16) & 0xff;
    NSUInteger green = (hex >> 8) & 0xff;
    NSUInteger blue = hex & 0xff;
    return [UIColor hm_colorWithRed:red green:green blue:blue alpha:alpha];
}
+ (instancetype)hm_randomColor {
    return [UIColor hm_colorWithRed:arc4random_uniform(256) green:arc4random_uniform(256) blue:arc4random_uniform(256) alpha:1];
}
@end
